﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Header.ascx.cs" Inherits="Golf.WebUI.UserControl.Header" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>

    <script type="text/javascript">

        window.jQuery || document.write('<script src="/Script/jquery/jquery-1.4.1.min-vsdoc.js" type="text/javascript"><\/script>');
    </script>

    <link href="/Style/Base.css" rel="stylesheet" type="text/css" />
    <link href="/Style/Header.css" rel="stylesheet" type="text/css" />
    <link href="/Style/index.css" rel="stylesheet" type="text/css" />

    <script src="/Script/jquery.hoverIntent.minified.js" type="text/javascript"></script>

    <style type="text/css">
        .subMenuContainer
        {
            z-index: 9999;
            position: inherit;
        }
    </style>

    <script type="text/javascript">
        $(function() {
            $("ul.preferences li a.expand").click(function(e) {
                e.preventDefault();
                var parentObj = $(this).parent();
                parentObj.find(".ieShim").slideToggle();
                if (parentObj.find(".expandedContent").is(":hidden")) {
                    parentObj.find("a.expand").addClass("open");
                    parentObj.find(".expandedContent").stop(true, true).slideDown("slow")
                } else {
                    parentObj.find(".expandedContent").stop(true, true).slideUp("slow",
                function() {
                    parentObj.find("a.expand").removeClass("open")
                })
                }
                $("ul.preferences li a.expand").not(this).removeClass("open");
                $("ul.preferences li a.expand").not(".open").parent().find(".expandedContent").hide();
                $("ul.preferences li").not(parentObj).find(".ieShim").hide();
                return false
            });
            $("ul.preferences li .expandedContent a.closeBox").click(function() {
                var closeObj = $(this).parent();
                closeObj.parent().find(".ieShim").hide();
                closeObj.slideUp("slow",
            function() {
                closeObj.parent().find("a.expand").removeClass("open")
            });
                return false
            })


            $(".topLevel > li").hoverIntent({
                sensitivity: 3,
                interval: 200,
                timeout: 0,
                over: function() {
                    $(this).addClass("open");
                },
                out: function() {
                    $(this).removeClass("open")
                }
            })
            $(".subMenuContainer").css("z-index", "9999");
            $(".subMenuContainer").css("display", "block");
        });
    </script>

    <!--[if lte IE 6]>  
    <script src="/Script/png_fix.js" type="text/javascript"></script>

    <script>
    /*pngTransparency settings*/
        DD_belatedPNG.fix('*');
		</script>

	<![endif]-->
    <!--[if lte IE 6]>
		<link rel="stylesheet" type="text/css" href="/Style/ie6.css" />
	<![endif]-->
    <style type="text/css">
        /*Mini shopping cart*/#expandedBasket
        {
            position: absolute;
            right: 30px;
            top: 53px;
            width: 289px;
            z-index: 9999999;
        }
        #expandedBasket .basketHeader
        {
            background: url(../Images/minicart/mod_header.png) no-repeat;
            width: 300px;
            height: 22px;
            margin-left: 2px;
        }
        #expandedBasket .items
        {
            background: url(../Images/minicart/basketBg.png) repeat-y;
            width: 270px;
            margin-left: 12px;
            margin-top: -4px;
            position: relative;
            left: 1px;
        }
        #expandedBasket #basketCarousel
        {
            margin-bottom: 0;
            overflow: auto;
            display: block;
        }
        #expandedBasket .items ul li
        {
            float: left;
            width: 249px;
            padding: 10px 0;
            border-bottom: 1px solid #CDCDCE;
        }
        #expandedBasket .items ul li div.image
        {
            vertical-align: text-top;
            width: 68px;
            float: left;
        }
        #expandedBasket .items ul li div.image a
        {
            width: 66px;
            display: block;
            float: left;
        }
        #expandedBasket .items ul li div.qty
        {
            vertical-align: top;
            width: 12px;
            float: left;
        }
        #expandedBasket .items ul li div.desc
        {
            width: 151px;
            vertical-align: top;
            margin: 0 0 0 5px;
            float: left;
        }
        #expandedBasket .items ul li div.desc p.del-msg
        {
            color: #333;
            font-size: 10px;
            font-weight: bold;
            margin-left: 10px;
        }
        #expandedBasket .items ul li div.desc p.priceText
        {
            font-size: 18px;
            margin-left: 10px;
            font-weight: normal;
        }
        #expandedBasket .items ul li div a.btn_updateQty
        {
            background: url(../Images/minicart/button_3.jpg) no-repeat;
            width: 87px;
            display: inline-block;
            line-height: 18px;
            height: 18px;
            color: white;
            font-size: 11px;
            cursor: pointer;
            border: none;
            text-transform: uppercase;
            float: left;
            margin-bottom: 5px;
            padding-left: 10px;
        }
        #expandedBasket .items ul li div a.btn_removeBin
        {
            width: 15px;
            height: 2px;
            padding-top: 15px;
            margin: 0 0 0 5px;
            display: block;
            overflow: hidden;
            float: left;
            background: url(../Images/minicart/remove_icon.png) no-repeat 0 0;
        }
        #expandedBasket #freeUk
        {
            margin-left: 2px;
            background: url(../Images/minicart/free_uk_delivery.png) no-repeat;
            height: 60px;
            width: 301px;
        }
        #expandedBasket .proceed
        {
            background: url(../Images/minicart/mod_footer.png) no-repeat;
            margin-left: 1px;
            width: 252px;
            height: 86px;
            padding: 8px 20px 0 30px;
        }
        #expandedBasket .proceed .sum-text
        {
            font-size: 14px;
            color: white;
            margin-bottom: 5px;
        }
        #expandedBasket .proceed p
        {
            font-size: 10px;
            color: #999;
            margin-bottom: 5px;
        }
        #expandedBasket .proceed .button1
        {
            background: url(../Images/minicart/button_1.png) no-repeat;
            padding: 2px 8px;
            float: left;
            display: inline-block;
            width: 74px;
            height: 18px;
            color: white;
            font-size: 11px;
            border: none;
            text-transform: uppercase;
        }
        #expandedBasket .proceed .button2
        {
            background: url(../Images/minicart/button_2.png) no-repeat;
            float: left;
            padding: 2px 11px;
            width: 135px;
            height: 18px;
            color: white;
            font-size: 11px;
            border: none;
            text-transform: uppercase;
        }
        #basket-summary
        {
            clear: right;
            float: right;
            position: relative;
            z-index: 9999999;
        }
    </style>

    <script type="text/javascript">
        $(function() {
            $("#header #basket-summary").hover(function() {
                $("#header #basket-summary #expandedBasket").css({ right: 35 });
            }, function() {
                $("#header #basket-summary #expandedBasket").css({ right: 9999 });
            });
        });
    </script>

</head>
<body>
    <div style="background-color: #fff; height: 175px; width: 1004px; margin: 0px auto;">
        <div class="header" id="header" style="padding-bottom: 10px; background: url(/Images/bodyBg-new.png) repeat-x 0 0;
            width: 1004px; height: 126px; padding-bottom: 10px; float: left;">
            <!---Top brand-->
            <div id="storeNav">
                <ul>
                    <li class="og"><a class="on" title="Online Golf" href="index.aspx">
                        <!-- Online Golf -->
                    </a></li>
                    <li class="Nike"><a title="Nike" href="#">
                        <!-- Nike -->
                    </a></li>
                    <li class="TaylorMade"><a title="TaylorMade" href="#">
                        <!-- TaylorMade -->
                    </a></li>
                    <li class="Mizuno"><a title="Mizuno" href="#">
                        <!-- Mizuno -->
                    </a></li>
                    <li class="Cobra"><a title="Cobra" href="#">
                        <!-- Cobra -->
                    </a></li>
                </ul>
            </div>
            <div style="clear: both;">
            </div>
            <a class="logo" title="Online Golf" href="http://<%= HttpContext.Current.Request.Url.Host %>/Index.aspx">
                <img id="logo" alt="Online Golf" src="/images/online-golf-logo.png" width="182" height="70">
            </a>
            <!---Shopping cart-->
            <div id="basket-summary">
                <div id="miniBasket">
                    <span class="lbl">Items:</span><span class="qty"><%=pro_Count%></span> <span class="lbl">
                        Total:</span><span class="qty">$<%=pro_SumPrice %></span> <a class="btn_viewBasket"
                            title="View Basket" href="http://<%= HttpContext.Current.Request.Url.Host %>/GolfCart/Cart.aspx">
                            View Basket</a>
                </div>
                <div id="expandedBasket" style="right: 9999px;">
                    <div class="basketHeader">
                    </div>
                    <div class="items" style="background-color: White;">
                        <div id="basketCarousel">
                            <ul id="basketList">
                                <%if (dt.Rows.Count > 0)
                                  {
                                      for (int i = 0; i < dt.Rows.Count; i++)
                                      {
                                %>
                                <li>
                                    <div class="image">
                                        <a href="http://<%= HttpContext.Current.Request.Url.Host %>/ProductDetail.aspx?id=<%=dt.Rows[i]["id"] %>"
                                            title="<%=dt.Rows[i]["Pro_Name"]%>">
                                            <img src="http://<%= HttpContext.Current.Request.Url.Host %>/ImageProducts/<%=dt.Rows[i]["Pro_Picture"].ToString().Split(',')[0] %>"
                                                id="" width="60" height="40" alt="<%=dt.Rows[i]["Pro_Name"]%>">
                                        </a>
                                    </div>
                                    <div class="desc">
                                        <p class="del-msg">
                                            <a href="http://<%= HttpContext.Current.Request.Url.Host %>/ProductDetail.aspx?id=<%=dt.Rows[i]["id"] %>"
                                                title="<%=dt.Rows[i]["Pro_Name"]%>">
                                                <%=dt.Rows[i]["Pro_Name"]%></a></p>
                                        <p class="priceText">
                                            $<%=dt.Rows[i]["Pro_Price"] %></p>
                                        <a id="btnUpdate" title="Update Quantity" class="btn_updateQty" href="#">Update Qty</a>
                                        <a onclick="return confirm('This will delete this product from your basket. Are you sure?');"
                                            id="btnDelete" title="Remove from Basket" class="btn_removeBin" href="#">Remove</a>
                                    </div>
                                    <div class="qty" style="clear: both;">
                                        <input name="txtQty" type="text" value="<%=getProNum(dt.Rows[i]["_Key"].ToString()) %>"
                                            maxlength="3" id="" onblur="if(this.value==''){this.value='0'};this.value = stockCount(this.value,3);"
                                            style="width: 35px; border: 1px solid #ccc;">
                                    </div>
                                </li>
                                <%}
                                  } %>
                            </ul>
                        </div>
                    </div>
                    <div id="freeUk">
                    </div>
                    <div class="proceed">
                        <p class="sum-text">
                            <%=pro_Count%>
                            Item(s) Subtotal: <span>$<%=pro_SumPrice %></span></p>
                        <p class="del-msg">
                            Delivery costs will be shown during checkout</p>
                        <p>
                            <a href="http://<%= HttpContext.Current.Request.Url.Host %>/GolfCart/Cart.aspx" class="button1">
                                Checkout</a> <a id="btnContinue" class="button2" href="http://<%= HttpContext.Current.Request.Url.Host %>/index.aspx">
                                    continue shopping</a></p>
                    </div>
                </div>
            </div>
            <div class="navigation">
                <ul class="topLevel">
                    <li class="home"><a title="" href="#"></a></li>
                    <li class="Golf-Clubs"><a title="Golf Clubs" href="/Golf-Clubs.aspx"><strong>&nbsp;&nbsp;&nbsp;Golf
                        Clubs&nbsp;&nbsp;&nbsp;</strong></a>
                        <div class="subMenuContainer">
                            <div class="bgTop">
                                <!-- -->
                            </div>
                            <div class="content">
                                <div class="catContainer">
                                    <h5>
                                        Shop by Category</h5>
                                    <ul class="subNav">
                                        <asp:Repeater ID="rep_Type" runat="server">
                                            <ItemTemplate>
                                                <li><a title=" <%#Eval("TypeName") %>" href="http://<%= HttpContext.Current.Request.Url.Host %>/Golfshow.aspx?typeid=<%#Eval("ID") %>">
                                                    <%#Eval("TypeName") %></a></li>
                                            </ItemTemplate>
                                        </asp:Repeater>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </li>
                    <!--New products  -->
                    <li class="Golf-Clubs"><a title="New products" href="/New-Products.aspx"><strong>&nbsp;&nbsp;&nbsp;New
                        products&nbsp;&nbsp;&nbsp;</strong></a> </li>
                    <!--Combo Sale   -->
                    <li class="Golf-Clubs"><a title="Combo Sale" href="http://<%=http_Host %>/Combo-Sale.aspx">
                        <strong>&nbsp;&nbsp;&nbsp;Combo Sale&nbsp;&nbsp;&nbsp;</strong></a> </li>
                    <li class="Golf-Clubs"><a title="Drivers " href="http://<%=http_Host %>/Drivers.aspx">
                        <strong>&nbsp;&nbsp;&nbsp;&nbsp;Drivers &nbsp;&nbsp;&nbsp;</strong></a> </li>
                    <!--Left hand  -->
                    <li class="Golf-Clubs"><a title="Left Hand" href="http://<%=http_Host %>/Left-Hand.aspx">
                        <strong>&nbsp;&nbsp;&nbsp;&nbsp;Left hand&nbsp;&nbsp;&nbsp; </strong></a></li>
                    <!--Irons sets -->
                    <li class="Golf-Clubs"><a title="Irons sets" href="http://<%=http_Host %>/Irons-Sets.aspx">
                        <strong>&nbsp;&nbsp;&nbsp;Irons sets&nbsp;&nbsp;&nbsp;</strong></a> </li>
                    <!--Yutube  -->
                    <li class="Golf-Clubs"><a title="Yutube" href="/GolfProducts.aspx"><strong>&nbsp;&nbsp;&nbsp;&nbsp;Yutube&nbsp;&nbsp;&nbsp;
                    </strong></a></li>
                    <li class="Golf-Clubs"><a title="Specials" href="/GolfProducts.aspx"><strong>&nbsp;&nbsp;&nbsp;&nbsp;Specials&nbsp;&nbsp;&nbsp;</strong></a>
                    </li>
                    <!--Contact Us -->
                    <li class="Golf-Clubs"><a title="Contact Us" href="/GolfProducts.aspx"><strong>&nbsp;&nbsp;&nbsp;Contact
                        Us&nbsp;&nbsp;&nbsp;</strong></a> </li>
                </ul>
            </div>
            <div class="preferenceBar">
                <fieldset id="search">
                    <label for="searchInput">
                        Search</label>
                    <input id="txtSearch" class="searchBox" onkeypress="javascript:if (event.keyCode == 13) {doSearch();}"
                        type="text" name="txtSearch" autocomplete="off">
                    <a class="searchButton" href="javascript:doSearch();"></a>
                </fieldset>

                <script language="javascript" type="text/javascript">
                    var t;
                    $(document).ready(function() {
                        var SearchBox = $(".searchBox");
                        //Automatic replenishment
                        SearchBox.keyup(function() {
                            if ($(".searchBox").val()) {
                                clearTimeout(t);
                                SearchBox = this;
                                t = setTimeout(function() {
                                    $("#searchDropDown").html('<h3 id="searchLoading">Retrieving Data</h3>');
                                    //$("#searchDropDown").replaceWith('<div id="searchDropDown"><h3 id="searchLoading">Retrieving Data</h3></div>');
                                    var url;
                                    url = document.location.protocol + '//' + window.location.hostname + '/modules/QuickSearch.aspx?SiS=0&SearchTerm=' + SearchBox.value;

                                    url = 'http://www.onlinegolf.co.uk/modules/QuickSearch.aspx?SiS=0&SearchTerm=' + SearchBox.value;
                                    //ajax
                                    $.ajax({ url: url, cache: true, type: "GET", success: function(html) {
                                        //Firefox bug failure also carry do not know why so you can't use this to
                                        //$("#searchDropDown").replaceWith(html);
                                        if (html) {
                                            $("#searchDropDown").replaceWith(html);
                                        } else {
                                            $("#searchDropDown").html(html);
                                        }
                                        $("#searchDropDown").css({ display: 'block', padding: '6px 6px 14px' });
                                    }
                                    });
                                }, 400);
                            }
                            else {
                                $("#searchDropDown").html('');
                                $("#searchDropDown").css({ padding: '0px 6px 0px' });
                            }
                        });
                        //Searchbox has focus
                        SearchBox.focus(function() {
                            $("#searchDropDown").fadeIn(500);
                        });
                        //Searchbox lost focus
                        SearchBox.blur(function() {
                            $("#searchDropDown").fadeOut(500);
                        });
                    });

                    function doSearch() {
                        var searchURL = "/search/index_q:";
                        searchURL = "http://www.onlinegolf.co.uk/search/index_q:";
                        window.location = searchURL + $(".searchBox").val() + ".aspx";
                    }              
                </script>

                <ul class="preferences">
                    <li id="rvTab"><a id="recentlyViewed" class="expand" href="#"><span></span></a>
                        <div class="expandedContent viewedContainer" style="z-index: 9999;">
                            <div class="scrollableContent rvContainer" id="cookie_pro" runat="server">

                                <script type="text/javascript">
                                    $(function() {
                                        //To determine whether the goods
                                        var isCookie = "<%=_isCookie %>";
                                        if (isCookie == "1") {
                                            $(".emptyMsg").html("");
                                        }
                                    });
                                </script>

                                <p class="emptyMsg">
                                    <em>No recently viewed products</em>
                                </p>
                                <p class="emptyMsg">
                                    Your recent history of products viewed will show here, you can quickly click back
                                    to them to help you browse our product range.</p>
                                <asp:Repeater ID="rep_cookie" runat="server">
                                    <ItemTemplate>
                                        <div class="product clearance">
                                            <h3>
                                                <a id="<%#Eval("id") %>" title="<%#Eval("pro_Name") %>" href="http://<%=http_Host %>/ProductDetail.aspx?id=<%#Eval("ID") %>">
                                                    <%#Eval("pro_Name")%></a>
                                            </h3>
                                            <div class="image">
                                                <a title="<%#Eval("pro_Name")%>" href="http://<%=http_Host %>/ProductDetail.aspx?id=<%#Eval("ID") %>">
                                                    <img id="<%#Eval("id")%>" alt="<%#Eval("pro_Name")%>" src="http://<%=http_Host %>/ImageProducts/<%#Eval("Pro_Picture")%>"
                                                        width="81" height="54">
                                                </a>
                                            </div>
                                            <%#Convert.ToInt32(Eval("Pro_Save")) <= 0 ? "<div class=\"price\"> PRICE <strong>$" + Eval("Pro_PromotionPrice") + "</strong></div> <div class=\"save\"></div>" : "<div class=\"price\"> PRICE <strong>$" + Eval("Pro_PromotionPrice") + "</strong></div> <div class=\"save\">SAVE <span>" + Eval("Pro_Save") + "%</span></div> <div class=\"rrp\">MRRP $" + Eval("Pro_MarketPrice") + "</div>"%>
                                            <a class="btn_moreInfo" title="<%#Eval("Pro_Name")%>" href="http://<%=http_Host %>/ProductDetail.aspx?id=<%#Eval("ID") %>">
                                                More Info</a>
                                        </div>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </div>
                            <a class="closeBox" title="Close" href="#">Close</a>
                        </div>
                    </li>
                    <li id="epTab" style=""><a id="settings" class="expand" href="#"><span></span></a>
                        <div class="expandedContent settingsContainer" style="">
                            <div class="settingsContent">
                                <div>

                                    <script type="text/javascript">
                                        $(function() {
                                            //The customer is logged in
                                            var isCookie = "<%=_isLogin %>";
                                            if (isCookie == "1") {
                                                $(".userLogin").hide();
                                                $(".topContent").show();
                                            } else {
                                                $(".userLogin").show();
                                                $(".topContent").hide();
                                            }
                                        });
                                    </script>

                                    <!-- USER SIGNIN -->
                                    <div class="userLogin">
                                        <div id="loginDetails">
                                            <a class="btn_loginLarge" title="Login" href="http://<%=http_Host %>/Customers/Account.aspx">
                                                Login</a>
                                        </div>
                                        <div id="signup">
                                            <h4>
                                                <em>No account, no problem</em> create an account and benefit from:</h4>
                                            <ul>
                                                <li>Personalised offers and promotions</li>
                                                <li>Save your delivery &amp; billing address</li>
                                                <li>Check your order history</li></ul>
                                            <a class="btn_createAccount" title="Create An Account" href="http://<%=http_Host %>/Customers/account.aspx?action=create"
                                                style="height: 15px;">
                                                <!-- Create Account  Here to leave a space not cheap  -->
                                            </a>
                                            <p>
                                                it's quick and easy...</p>
                                        </div>
                                    </div>
                                    <div class="topContent">
                                        <h2>
                                            Welcome back, <span>
                                                <%=Customer_Email%></span>
                                        </h2>
                                        <p>

                                            <script type="text/javascript">
                                                $(function() {
                                                    //logout
                                                    $("#btnLogout").click(function() {
                                                        if (confirm('This will log you out of your account.\n\n\n\n Are you sure you wish to continue?'))
                                                            $.ajax({
                                                                type: "POST",
                                                                contentType: "application/x-www-form-urlencoded",
                                                                url: "http://<%=http_Host %>/Customers/Account.aspx?" + Math.random(),
                                                                data: {
                                                                    "action": "loginout"
                                                                },
                                                                success: function(msg) {
                                                                    msg = msg.split('|')[0];
                                                                    if (msg == '0') {
                                                                        window.location.href = 'http://<%=http_Host %>/Index.aspx';
                                                                    }
                                                                },
                                                                error: function(xhr) {
                                                                    alert(xhr.responseText);
                                                                }
                                                            });
                                                    });
                                                    $("#btnNotMe").click(function() {
                                                        $("#btnLogout").click();
                                                    });
                                                });
                                            </script>

                                            (if you're not
                                            <%=Customer_Email%>
                                            <a id="btnNotMe" title="Click Here" href="javascript:void();">Click Here</a>)</p>
                                        <div style="margin-left: 20px; padding-left: 14px; float: right; background: url(/common/images/shell/bulletGreen.png) no-repeat scroll 0px 8px transparent;">
                                            <a id="btnLogout" title="Logout" href="javascript:void();" style="font-weight: bold;
                                                text-decoration: underline;">Logout</a>
                                        </div>
                                        <div style="clear: both">
                                        </div>
                                        <h4>
                                            Future orders</h4>
                                        <br />
                                        <table cellspacing="0" cellpadding="0" style="border: 1px solid gray; width: 100%;
                                            line-height: 25px;">
                                            <tbody>
                                                <%if (dt2.Rows.Count > 0)
                                                  {
                                                      for (int i = 0; i < dt2.Rows.Count; i++)
                                                      {
                                                %><tr>
                                                    <td>
                                                        <a href="http://<%=http_Host %>/Customers/Order.aspx?id=<%=dt2.Rows[i]["id"] %>">
                                                            <%=dt2.Rows[i]["OrderNumber"]%></a>
                                                    </td>
                                                    <td>
                                                        <%=dt2.Rows[i]["OrderGeneratedTime"]%>
                                                    </td>
                                                </tr>
                                                <%}
                                                  }
                                                  else
                                                  {%>
                                                <tr>
                                                    <td colspan="6" align="center">
                                                        shopping cart is empty
                                                    </td>
                                                </tr>
                                                <%}%>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                            <a class="closeBox" title="Close" href="#">Close</a>
                        </div>
                        <!-- Content works -->
                    </li>
                </ul>
                <a class="myAccount" title="My Account" href="http://<%=http_Host %>/Customers/Account.aspx">
                </a>
            </div>
            <div style="clear: both; width: 1px; height: 1px;">
            </div>
        </div>
    </div>
</body>
</html>
